<?php
$v =  $modelObj->{fieldName};
if($v == "NULL" || $v===null){
     $v = NULL;
}
?>